package com.syp.envops.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.syp.auth.export.common.GeneralUserVo;
import com.syp.auth.export.common.GorgeousParameters;
import com.syp.auth.export.resource.AuthorizeResourceI;

/**
 * 
 * @author syp
 * 
 */
@Controller
@RequestMapping("/layout")
public class LayoutController {

	@Autowired
	private AuthorizeResourceI authorizeResource;

	@RequestMapping("/top")
	public ModelAndView top(@CookieValue(GorgeousParameters.AUTH_COOKIE_NAME) String sid) {
		ModelAndView mv = new ModelAndView("layout/top");
		GeneralUserVo guser = this.authorizeResource.cuser(sid);
		mv.addObject("myInfo", guser);
		return mv;
	}

	@RequestMapping("/left")
	public String left() {
		return "layout/left";
	}

	@RequestMapping("/right")
	public String right() {
		return "layout/right";
	}

	@RequestMapping("/bottom")
	public String bottom() {
		return "layout/bottom";
	}

	@RequestMapping("/banner")
	public String banner() {
		return "layout/banner";
	}

}
